<?php
    error_reporting(E_ALL^E_NOTICE);
    require_once('../../config/config.php');
    date_default_timezone_set("PRC");
	session_start();
    $res=mysqli_query($con,"select VERSION()");
    $row=mysqli_fetch_row($res);
    if(empty($_SESSION['admin'])){
        echo "<script>location='./no.php';</script>";
    }
    
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>欢迎页面</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
        <link rel="stylesheet" href="../css/font.css">
        <link rel="stylesheet" href="../css/xadmin.css">
    </head>
    <body>
    <div class="x-body layui-anim layui-anim-up">
        <blockquote class="layui-elem-quote">欢迎管理员：
            <span class="x-red"><?php echo $_SESSION['admin'];?></span> ！当前时间：<?php echo date('Y/m/d H:i:s');?></blockquote>
        <fieldset class="layui-elem-field">
            <legend>数据统计</legend>
            <div class="layui-field-box">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body">
                            <div class="layui-carousel x-admin-carousel x-admin-backlog" lay-anim="" lay-indicator="inside" lay-arrow="none" style="width: 100%; height: 90px;">
                                <div carousel-item="">
                                    <ul class="layui-row layui-col-space10 layui-this">
                                        <li class="layui-col-xs2">
                                            <a href="javascript:;" class="x-admin-backlog-body">
                                                <h3>用户数</h3>
                                                <p>
                                                    <cite>
                                                        <?php 
                                                            $total=mysqli_num_rows(mysqli_query($con,"select * from user"));
                                                            echo $total;
                                                        ?>
                                                    </cite>
                                                </p>
                                            </a>
                                        </li>
                                        <li class="layui-col-xs2">
                                            <a href="javascript:;" class="x-admin-backlog-body">
                                                <h3>分类数</h3>
                                                <p>
                                                    <cite>
                                                        <?php 
                                                            $total=mysqli_num_rows(mysqli_query($con,"select * from book_class"));
                                                            echo $total;
                                                        ?>
                                                    </cite>
                                                </p>
                                            </a>
                                        </li>
                                        <li class="layui-col-xs2">
                                            <a href="javascript:;" class="x-admin-backlog-body">
                                                <h3>图书数</h3>
                                                <p>
                                                    <cite>
                                                        <?php 
                                                            $total=mysqli_num_rows(mysqli_query($con,"select * from book_sharing"));
                                                            echo $total;
                                                        ?>
                                                    </cite>
                                                </p>
                                            </a>
                                        </li>
                                        <li class="layui-col-xs2">
                                            <a href="javascript:;" class="x-admin-backlog-body">
                                                <h3>管理员数</h3>
                                                <p>
                                                    <cite>
                                                        <?php 
                                                            $total=mysqli_num_rows(mysqli_query($con,"select * from master"));
                                                            echo $total;
                                                        ?>
                                                    </cite>
                                                </p>
                                            </a>
                                        </li>
                                        <li class="layui-col-xs2">
                                            <a href="javascript:;" class="x-admin-backlog-body">
                                                <h3>借阅次数</h3>
                                                <p>
                                                    <cite>
                                                        <?php 
                                                            $total=mysqli_num_rows(mysqli_query($con,"select * from borrowing_record"));
                                                            echo $total;
                                                        ?>
                                                    </cite>
                                                </p>
                                            </a>
                                        </li>
                                        <li class="layui-col-xs2">
                                            <a href="javascript:;" class="x-admin-backlog-body">
                                                <h3>借阅异常</h3>
                                                <p>
                                                    <cite>
                                                        <?php 
                                                            //$total=mysqli_num_rows(mysqli_query($con,"select * from OpsLog"));
                                                            //echo $total;
                                                            echo "0";
                                                        ?>
                                                    </cite>
                                                </p>
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </fieldset>
        <fieldset class="layui-elem-field">
            <legend>系统通知</legend>
            <div class="layui-field-box">
                <table class="layui-table" lay-skin="line">
                    <tbody>
                        <tr>
                            <td >
                                <a class="x-a" href="javascript:alert('系统正在开发中，请您悉知！');">系统正在开发中</a>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </fieldset>
        <fieldset class="layui-elem-field">
            <legend>系统信息</legend>
            <div class="layui-field-box">
                <table class="layui-table">
                    <tbody>
                        <tr>
                            <th>服务器地址</th>
                            <td><?php echo  $_SERVER['SERVER_NAME'] ;?></td></tr>
                        <tr>
                            <th>服务器端口</th>
                            <td><?php echo $_SERVER['SERVER_PORT'];?></td></tr>
                        <tr>
                            <th>操作系统</th>
                            <td><?php echo php_uname('s').php_uname('r');?></td></tr>
                        <tr>
                            <th>PHP版本</th>
                            <td><?php echo PHP_VERSION ;?></td></tr>
                        <tr>
                            <th>PHP运行方式</th>
                            <td><?php echo php_sapi_name();?></td></tr>
                        <tr>
                            <th>MYSQL版本</th>
                            <td><?php echo $row[0];?></td></tr>
                        <tr>
                            <th>Zend版本</th>
                            <td><?php echo Zend_Version();?></td></tr>
                        <tr>
                            <th>上传附件限制</th>
                            <td><?php echo get_cfg_var ("upload_max_filesize")?get_cfg_var ("upload_max_filesize"):"不允许";?></td></tr>
                        <tr>
                            <th>执行时间限制</th>
                            <td><?php echo get_cfg_var("max_execution_time")."秒 ";?></td></tr>
                    </tbody>
                </table>
            </div>
        </fieldset>
        <fieldset class="layui-elem-field">
            <legend>开发团队</legend>
            <div class="layui-field-box">
                <table class="layui-table">
                    <tbody>
                        <tr>
                            <th>版权所有</th>
                            <td>cdnuti(xuebingsi)
                                <a href="http://#/" class='x-a' target="_blank">访问官网</a></td>
                        </tr>
                        <tr>
                            <th>开发者</th>
                            <td>along(370946531@qq.com)</td></tr>
                    </tbody>
                </table>
            </div>
        </fieldset>
        <blockquote class="layui-elem-quote layui-quote-nm">感谢layui,百度Echarts,jquery,本系统由L-admin提供技术支持。</blockquote>
    </div>
   
    </body>
</html>